﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WordsGame
{
    public class Player : IComparable, IEquatable<Player>
    {
        public string Name { get; set; }
        public int Score { get; set; }

        public Player()
        {
            
        }

        public Player(string name)
        {
            Name = name;
            Score = 0;
        }

        public int CompareTo(object obj)
        {
            var other = (Player)obj;
            return Score - other.Score;
        }

        public bool Equals(Player other)
        {
            return string.Compare(Name, other.Name, 
                StringComparison.InvariantCultureIgnoreCase) == 0;
        }
    }
}
